package com.service.impl;

import com.dao.UserDao;
import com.entity.User;
import com.service.UserService;

public class UserServiceImpl implements UserService {

	private UserDao userDao;

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public User loginUser(int id, String password) {
		User user = userDao.findUser(id);
		if (password != ""
				&& userDao.findUser(id).getPassword().equals(password)) {
			return user;
		}
		return null;
	}

}
